package ru.papergames.web.blines.battle.network.serverpackets;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;


/**
 * @author: atroshanin
 * Date: 22.05.2010
 * Time: 19:14:04
 */
public class BattleCreated extends WebServerServerPacket {

    private static Log log = LogFactory.getLog(BattleCreated.class);

    private int battleOrderId;

    @Override
    protected void readImpl() {
//        long createTime = System.currentTimeMillis() - TestTimer.startBattleCreateRequest;
        battleOrderId = readD();
        log.info("BattleCreated: [battleOrderId:" + battleOrderId + "]");
    }

    @Override
    protected void runImpl() {
        log.debug("BattleCreated.runImpl");
        getClient().getConnectionHolder().onBattleCreateOk(battleOrderId);
    }

    @Override
    public String getType() {
        return "[s] BattleCreated[0x03]";
    }
}
